import request from '@/router/request_sys';
import qs from 'qs';

// 教室用途
export function queryRoomPurpose(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/conferencePurpose',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/conferencePurpose',
            method: methodType,
            data
        })
    }
}
// 教室类型
export function queryRoomType(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/conferenceType',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/conferenceType',
            method: methodType,
            data
        })
    }
}
// 教室设备
export function queryEquipmente(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/conferenceRoomEquips',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/conferenceRoomEquips',
            method: methodType,
            data
        })
    }
}
// 教室室列表
export function queryClassroomList(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/conferenceRoom',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/conferenceRoom',
            method: methodType,
            data
        })
    }
}
// 接待物资
export function queryMaterialList(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/mrMaterial',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/mrMaterial',
            method: methodType,
            data
        })
    }
}
// 获取教室预约状态
export function queryRoomStatus() {
    return request({
        url: 'api/conferenceConfig',
        method: 'get'
    })
}
// 获取教室预约详情列表
export function queryRoomDetailList(data) {
    return request({
        url: 'api/conferenceRecord/list',
        method: 'get',
        params: data
    })
}

// 新增物资
export function queryMaterialSub(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/recordDtl',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/recordDtl',
            method: methodType,
            data
        })
    }
}
// 获取会议室预约列表
export function querySubscribeRoomList(data) {
    return request({
        url: 'api/conferenceRecord',
        method: 'get',
        params: data
    })
}
// 根据ID查询具体预约信息
export function queryInfoWithId(data) {
    return request({
        url: 'api/conferenceRecord/find',
        method: 'get',
        params: data
    })
}
// 根据ID查询具体预约信息
export function queryRoomInfoWithId(data) {
    return request({
        url: 'api/conferenceRoom/find',
        method: 'get',
        params: data
    })
}
// 会议室预约详情
export function querySubscribeInfo(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/conferenceRecord',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/conferenceRecord',
            method: methodType,
            data
        })
    }
}
// 取消会议室预约
export function queryChanel(data) {
    return request({
        url: 'api/conferenceRecord/cancel',
        method: 'put',
        data
    })
}


// 会议室预约接口
export function queryRoomSubscribe(data) {
    return request({
        url: 'api/conferenceRecord',
        method: 'post',
        data
    })
}
// 获取未使用的教室列表
export function queryNotExpired() {
    return request({
        url: 'api/conferenceRecord/NotExpired',
        method: 'get'
    })
}
// 公告信息
export function queryNoticeList(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/Notice',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/Notice',
            method: methodType,
            data
        })
    }
}
// 注意事项
export function queryTipsList(data, methodType) {
    if (methodType === 'get') {
        return request({
            url: 'api/Attention',
            method: 'get',
            params: data
        })
    } else {
        return request({
            url: 'api/Attention',
            method: methodType,
            data
        })
    }
}
// 获取教室预约报表
export function queryRoomReport(data) {
    return request({
        url: 'api/appointmentRep',
        params: data
    })
}
// 获取当前会议室费用（修改结束时间时）
export function queryRoomCost(data) {
    return request({
        url: 'api/recordDtl/roomCost',
        method: 'get',
        params: data
    })
}
// 导出教室预约报表
export function queryRoomReportExport(data) {
    return request({
        url: 'api/appointmentRep/export',
        method: 'get',
        params: data
    })
}
// 结算
export function querySettle(data) {
    return request({
        url: 'api/recordDtl/settle',
        method: 'post',
        data
    })
}
export function queryUser(data) {
    return request({
        url: 'api/users/query',
        method: 'get',
        params: data
    })
}
//  api/conferenceRoom/purposes
export function queryPurposesById(data) {
    return request({
        url: 'api/conferenceRoom/purposes',
        method: 'get',
        params: data
    })
}
export default {
    queryRoomPurpose, queryRoomType,
    queryEquipmente, queryClassroomList,
    queryMaterialList, queryRoomStatus,
    querySubscribeRoomList, queryInfoWithId, queryRoomSubscribe,
    queryRoomInfoWithId, queryRoomDetailList,
    queryNotExpired, queryNoticeList, queryRoomReport,
    queryRoomReportExport, querySubscribeInfo, queryMaterialSub, queryRoomCost, queryTipsList,
    querySettle, queryUser, queryPurposesById,queryChanel
};